[IA64] Compile iosapic within xen
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 21 Apr 2006 14:56:34 +0000 (08:56 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Fri, 21 Apr 2006 14:56:34 +0000 (08:56 -0600)
Compile iosapic within xen. Part of code from Tristan.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

xen/arch/ia64/linux-xen/Makefile
xen/arch/ia64/linux-xen/iosapic.c
xen/include/asm-ia64/config.h
xen/include/asm-ia64/linux-xen/asm/iosapic.h

index ca5354b343c477ab9e31554594d7d5aa633f5411..7adea3519f1e086daa3e350cff4914f1f336a230 100644 (file)
@@ -13,3 +13,4 @@ obj-y += time.o
 obj-y += tlb.o
 obj-y += unaligned.o
 obj-y += unwind.o
+obj-y += iosapic.o
index 574084f343fad79b32406c6e8b354c23554594bf..9d964abba492d3e7a6723800dcb3f2af123275de 100644 (file)
@@ -75,7 +75,9 @@
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
+#ifndef XEN
 #include <linux/pci.h>
+#endif
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/string.h>
@@ -524,7 +526,11 @@ static struct iosapic_rte_info *iosapic_alloc_rte (void)
        int preallocated = 0;
 
        if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) {
+#ifdef XEN
+               rte = xmalloc_bytes(sizeof(struct iosapic_rte_info) * NR_PREALLOCATE_RTE_ENTRIES);
+#else
                rte = alloc_bootmem(sizeof(struct iosapic_rte_info) * NR_PREALLOCATE_RTE_ENTRIES);
+#endif
                if (!rte)
                        return NULL;
                for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++)
index 2d541d2a6a7f203fb6c2fd7bb8d6b9b8283e0927..ff9971e66e781476e7c8abd299fe0ce7a6359044 100644 (file)
@@ -35,6 +35,7 @@
 #endif
 #define CONFIG_NR_CPUS NR_CPUS
 
+#define CONFIG_IOSAPIC
 #define supervisor_mode_kernel (0)
 
 #define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
index 20f98f1751a19677795035356972993d8aa24709..ab6c584a7508e475976514ba2614cae8211a7659 100644 (file)
@@ -108,5 +108,37 @@ extern void __devinit map_iosapic_to_node (unsigned int, int);
        polarity,trigger)                                       (gsi)
 #endif
 
+#ifdef XEN
+/* Move to common code later */
+/**
+ * list_move - delete from one list and add as another's head
+ * @list: the entry to move
+ * @head: the head that will precede our entry
+ */
+static inline void list_move(struct list_head *list, struct list_head *head)
+{
+        __list_del(list->prev, list->next);
+        list_add(list, head);
+}
+
+#define move_irq(x)
+
+#define WARN_ON(condition) do { \
+       if (unlikely((condition)!=0)) { \
+               printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
+               dump_stack(); \
+       } \
+} while (0)
+
+#ifdef nop
+#undef nop
+#endif
+
+/* nop for now */
+static inline void
+set_irq_affinity_info(unsigned int irq, int hwid, int redir) {}
+
+#endif /* XEN */
+
 # endif /* !__ASSEMBLY__ */
 #endif /* __ASM_IA64_IOSAPIC_H */